@extends('admin.layout.main')

@section('content')
<div class="breadcrumbs ace-save-state" id="breadcrumbs">
<ul class="breadcrumb">
	<li>
		<i class="ace-icon fa fa-home home-icon"></i>
		<a href="#">首页</a>
	</li>
	<li><a href="#">系统钱包管理</a></li>
	<li class="active"><a href="{{ url('admin/withdraw_list') }}">提币申请记录 </a></li>
</ul><!-- /.breadcrumb -->

</div>
<div class="page-content">
	<div class="row">
		<div class="col-xs-12">
			<div class="row">
				<div class="search-area well col-xs-12">
					<form action="">
						<div class="pull-left">
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<i class="icon-only ace-icon fa fa-th"></i>
							<b class="text-primary">状态: </b>
							&nbsp;
							<div id="toggle-result-format" class="btn-group btn-overlap" data-toggle="buttons">
								<select class="" name="status" style="width:100px;">
                                    <option value="99">全部</option>
									@foreach(\App\Models\Turn::$STATUS as $k => $v)
                                    <option value="{{$k}}" @if($status==$k) selected="selected" @endif>{{$v}}</option>
									@endforeach
                                </select>
							</div>

                            <i class="icon-only ace-icon fa fa-th"></i>
                            <b class="text-primary">币种: </b>
                            &nbsp;
                            <div id="toggle-result-format" class="btn-group btn-overlap" data-toggle="buttons">
                                <select class="" name="cid" style="width:100px;">
                                    <option value="99">全部</option>
                                    @foreach($currs as $curr)
                                        <option value="{{$curr->id}}" @if($cid==$curr->id) selected="selected" @endif>{{$curr->name_en}}</option>
                                    @endforeach
                                </select>
                            </div>

                            <i class="icon-only ace-icon fa fa-th"></i>
                            <b class="text-primary">地址: </b>
                            &nbsp;
                            <div id="toggle-result-format" class="btn-group btn-overlap" data-toggle="buttons">
                                <input type="text" name="address" style="width:300px;">
                            </div>
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<button type="submit" class="btn btn-white btn-info btn-bold">查询</button>
						</div>
					</form>
				</div>
			</div>


			<!-- PAGE CONTENT BEGINS -->
			<div class="row">
				<div class="col-xs-12">
					<!-- div.table-responsive -->
					<!-- div.dataTables_borderWrap -->
					<div>
						<table id="dynamic-table" class="table table-striped table-bordered table-hover">
							<thead>
								<tr>
									<th>序号</th>
									<th>用户</th>
									<th>币种</th>
									<th>用户当前资产</th>
                                    <th>用户冻结资产</th>
                                    <th>用户钱包地址</th>
                                    <th>提币数量</th>
                                    <th>提币手续费</th>
                                    <th>状态</th>
									<th>操作</th>
								</tr>
							</thead>

							<tbody>
								@foreach($data as $key=>$value)
                                    <tr>
                                        <td>{{$key+$page_num}}</td>
                                        <td>{{$value->user->account}}</td>
                                        <td>{{$value->currency->name_en}}</td>
                                        <td>{{$value->user->currency_property($value->cid)->first()->balance}}</td>
                                        <td>{{$value->user->currency_property($value->cid)->first()->blocked}}</td>
                                        <td>{{$value->wallet_address}}</td>
                                        <td>{{$value->num}}</td>
                                        <td>{{$value->proc}}</td>
                                        <td>{{\App\Models\Turn::$STATUS[$value->status]}}</td>
                                        <td>
                                            @if($value->status == 1)
											<a href="/admin/confirm_currency?turn_id={{$value->id}}"><button class="btn btn-xs btn-info">确认发币</button></a>
											<a href="/admin/reject_apply?turn_id={{$value->id}}"><button class="btn btn-xs btn-danger">驳回</button></a>
                                            @endif
                                        </td>
                                    </tr>
								@endforeach
							</tbody>
						</table>
					</div>
				</div>
			</div>
			<!-- PAGE CONTENT ENDS -->
		</div><!-- /.col -->

	</div><!-- /.row -->
	<div class="no-margin-top">
		<ul class="pagination pull-right no-margin">
            {{$data->appends(['status' => $status, 'cid' => $cid, 'address' => $address])->links()}}
		</ul>
	</div>
</div><!-- /.page-content -->

@endsection
